Interactive CRUD + S3 Student Picture

UI ⇄ API (EC2) ⇄ S3 ⇄ RDS · API auto-creates picture_key · Secrets · Read Replica · MCQ Trainer
CRUD + S3 Design
Secure coding & access control
Versioned API /v2
Design version: v2.1 – API creates picture_key

1. UI Layer

Browser / SPA where students and staff interact.

Student form Name, course, email → JSON to API.
Picture selector <input type="file"> + client preview.
Presigned PUT Browser uploads directly to S3 using signed URL.

2. API Layer (EC2)

Node.js/Express API with IAM role for S3 & RDS.

CRUD endpoints /v2/students manage metadata in RDS.
API creates picture_key On POST /v2/students, generates students/{id}.jpg and saves to DB.
Presigned URL generator Uses S3 SDK for putObject & getObject.

3. Storage Layer

S3 for binaries, RDS for metadata & relationships.

Amazon S3 (private) Keys like students/{id}.jpg, bucket blocks public access.
Amazon RDS students table stores name, email, course, picture_key.
Read replica Optional replica for heavy reads (e.g., list all students).